import { FC } from "react"
import { status } from "./index"
// 声明类型
type Iprops = {
    onChangeState(status: status): void;
    countsArr: Array<number>
}
const Todooptions: FC<Iprops> = (props) => {
    let { onChangeState, countsArr } = props;
    return (
        <fieldset>
            <legend>选项</legend>
            <button onClick={() => {
                onChangeState(status.all)
            }}>全部:{countsArr[0] }条数据</button>
            <button onClick={() => {
                onChangeState(status.completed)
            }}>已完成:{countsArr[1] }条数据</button>
            <button onClick={() => {
                onChangeState(status.unCompleted)
            }}>未完成:{countsArr[2] }条数据</button>
        </fieldset>
    )
}

export default Todooptions